package com.mk.settlement.service;

import java.util.Date;
import java.util.List;

import com.mk.settlement.enums.FeeTypeEnums;
import com.mk.settlement.enums.SaleTypeEnums;
import com.mk.settlement.enums.SettlementCategoryEnums;
import com.mk.settlement.enums.SettlementTypeEnums;
import com.mk.settlement.model.SettlementOrder;
import com.mk.settlement.model.SettlementRelation;
import com.mk.settlement.model.SettlementResult;
import com.mk.settlement.model.SettlementRule;

/**
 * 结算service
 * @author Administrator
 *
 */
public interface SettlementService {
	
	//规则初始化
	public void addSettlementRule(SettlementRule settlementRule);
	
	//规则映射关系初始化
	public int addSettlementRelation(SettlementRelation settlementRelation);
	
	//订单基础表添加数据
	public void addSettlementOrder(SettlementOrder SettlementOrder);
	
	//根据hotelid 或 otaid 查询结算规则
	public List<SettlementRule> getSettlementRulesByTarId(Long settlementTargetId, String payType);
	
    public boolean reSettlement(Long settlementTargetId, FeeTypeEnums feeType, Date settlementTime, SaleTypeEnums saleType, SettlementCategoryEnums settlementCategory,
            SettlementTypeEnums settlementType);
    
    public boolean settlementByBoss(Long settlementTargetId) throws Exception;
	
    public boolean reSettlement(SettlementResult settlementResult);
    
    public String canSettlement(Long settlementTargetId);
    
    public String initRelation(int ruleId); 

    
    public int insertDefaultRelation(Long settlementTargetId, String settlementTargetName, String mark);
    
    public List<SettlementRule> getRulesByIds(List<Integer> ruleIds);
    
}
